home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Fonts / installfont / makelinks < prev    next >
Encoding:
Text File  |  1993-06-06  |  1.3 KB  |  47 lines

  1. #!/bin/csh -f
  2. # Old style font symlink program by Otto J. Makela <otto@jyu.fi>
  3. # Distributed under the GNU Public Licence -- see file COPYING for details
  4. set progname="$0"
  5. set progname="$progname:t"
  6.  
  7. echo "${progname} 1.0 (c) 1993 by Otto J. Makela"
  8. echo "Distributed under the GNU Public Licence -- see file COPYING for details"
  9.  
  10. if ( $#argv>0 && -d "$1" ) then
  11.     set todir="$1"
  12.     shift
  13. else
  14.     set todir=~/Library/Fonts
  15. endif
  16.  
  17. if ( ! -d "$todir" ) mkdir $todir
  18. if ( ! -d "$todir" ) then
  19.     echo "${progname}: directory $todir does not exist and can't be made"
  20.     exit 1
  21. endif
  22.  
  23. foreach directory ( afm outline bitmap )
  24.     if ( ! -d "${todir}/${directory}" ) then
  25.         echo "${progname}: mkdir ${todir}/${directory}"
  26.         mkdir "${todir}/${directory}"
  27.     endif
  28. end
  29.  
  30. if ( $#argv == 0 ) set argv=( ${todir}/*.font )
  31.  
  32. foreach fontdirectory ( $* )
  33.     echo "${progname}: ${fontdirectory}"
  34.     set fontname="${fontdirectory:t}"
  35.     set fontname="${fontname:r}"
  36. # Just one PostScript font
  37.     ln -s "${fontdirectory}/${fontname}" "${todir}/outline"
  38. # There may be lots of .afm files, one for each screen bitmap font
  39.     foreach afmfile ( ${fontdirectory}/*.afm )
  40.         ln -s "$afmfile" "${todir}/afm"
  41.     done
  42. # There need not be any bitmaps
  43.     if ( -f "${fontdirectory}/${fontname}.bepf" ) then
  44.         ln -s "${fontdirectory}/${fontname}.bepf" "${todir}/bitmap"
  45.     endif
  46. end
  47.